<div class="mainbox">
	<div class="tagbox">
		{{#if $Cache.tags_detail.length}}
		{{#each $Cache.tags_detail}}
			<a class="tag" href="#default/tags?tag_id={{_id}}">{{tag_name}}({{content.length}})</a>
		{{/each}}
		{{#else}}
		<p>暂无产品分类</p>
		{{/if}}
	</div>

	<div class="eachtag">
	    <div class="tagtitle">
	    {{tagTitle}}
	    </div>
		{{#if $Cache.pointer_tag.detail_content.length}} {{#each $Cache.pointer_tag.detail_content}}
		<egoodsitem
            href="{{_id}}"
            src="{{preview_img_url}}"
            goodsname="{{goods_name}}"
            price="{{price+'/'+unit}}"
        ></egoodsitem>
		{{/each}}
		{{#else}}
		<p>此分类下没有商品</p>
		{{/if}}
	</div>

</div>

<xmp type="tag" name="egoodsitem">
    <a href="#default/goods_details?id=${href}">
        <div class="goodsitem">
            <img bind-src="${src}?imageView/1/w/150" />
            <div class="goodsinfo">
                <div class="item">${goodsname}</div>
                <div class="item">
                    <span class="price">￥${price}</span>
                </div>
            </div>
        </div>
    </a>
    <script type="text/vm">
    function(vm){
        var goodsitem=vm.queryElement({
            className:"goodsitem"
        })[0];
        require(["jQuery"], function() {
            if ($(document).width() > 500) {
                $(goodsitem).css({
                    'width': '31%'
                });
            };
        })
    }
    </script>
</xmp>
